package com.study.jvm.demo.classload;

import com.study.jvm.load.demo.MyClassLoader;

public class MyClassLoaderTest {

    public static void main(String[] args) {
        MyClassLoader classLoader = new MyClassLoader();
        classLoader.setRoot(System.getProperty("user.dir"));
        Class<?> testClass = null;
        try {
            testClass = classLoader.loadClass("com.study.entity.Test");
            Object object = testClass.newInstance();
            System.out.println(object.getClass().getClassLoader());
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }
}
